package com.woniuxy.main.mycenter_ty.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.woniuxy.main.mycenter_ty.mapper.MyCenterMapper;
import com.woniuxy.main.mycenter_ty.pojo.Follow;
import com.woniuxy.main.mycenter_ty.pojo.User_Ty;
import com.woniuxy.main.mycenter_ty.service.MyCenterService;

@Service
public class MyCenterServiceImpl  implements MyCenterService{
	@Autowired
	private MyCenterMapper myCenterMapper;
	

	@Override
	public User_Ty queryAllInfoByPhone(String phone) {   // 查询个人资料
		return myCenterMapper.queryAllInfoByPhone(phone);				 
	}

	@Override
	public Integer myFollow(int uid) {    // 我关注数		
		return myCenterMapper.myFollow(uid);
	}

	@Override
	public Integer followMe(int uid) {   // 粉丝数		
		return myCenterMapper.followMe(uid);
	}

	@Override
	public void updateInfo(User_Ty user) {    // 更新个人资料
		myCenterMapper.updateInfo(user);
		
	}

	@Override
	public List<Follow> queryFans(int id) {   // 查询粉丝的信息		
		return myCenterMapper.queryFans(id);
	}

	@Override
	public List<Follow> queryFollow(int id) {  // 查询本人关注
		return myCenterMapper.queryFollow(id);
	}

	@Override
	public void addFirend(Follow fan) {  // 关注自己的粉丝，变为好友
		myCenterMapper.addFirend(fan);		
	}

	@Override
	public void delFollow(Follow fan) {  // 删除本人已关注
		myCenterMapper.delFollow(fan);		
	}

	@Override
	public User_Ty queryAllInfoByUser_id(Integer uid) {  //查询指定user_id的用户详细资料		
		return myCenterMapper.queryAllInfoByUser_id(uid);
	}

	@Override
	public Integer sreachApprove(Integer userId) {
		return myCenterMapper.sreachApproveState(userId);
	}

	@Override
	public String upApprove(Integer userId) {//修改认证状态
		myCenterMapper.upApproveStateState(userId);
		myCenterMapper.upApproveState(userId);
		
		return "认证已提交!";
	}
	
	
	
}
